<template>
  <div>
      添加标题：<input type="text" v-model="bb.biaoti"><br>
      添加内容：<input type="text" v-model="bb.neirong"><br>
      <button @click="qq">确认添加</button>
      <table border="1">
          <tr>
              <td>id</td>
              <td>标题</td>
              <td>内容</td>
          </tr>
          <tr v-for="i in aa">
              <td>{{i.id}}</td>
              <td>{{i.biaoti}}</td>
              <td>{{i.neirong}}</td>
          </tr>
      </table>
  </div>
</template>

<script>
export default {
    name:'aaa',
    data(){
        return{
            aa:[],
            bb:{
                biaoti:"",
                neirong:""
            }
        }
    },
    mounted(){
        this.gen()
    },
    methods:{
        gen(){
            this.$axios.get(`aa/`).then(item=>{
                this.aa = item.data
            })
        },
        qq(){
            this.$axios.post(`aa/`,this.bb).then(item=>{
                alert('添加成功')
            })
        }
    }
}
</script>

<style>

</style>